/**
 * 视频收藏相关接口
 */
import request from '@/config/request'
import type { CvVideoFavouriteSearchReqVO } from '@/types/favourite'

/**
 * 获取视频收藏分页列表
 */
export const getFavouritePage = (reqVO: CvVideoFavouriteSearchReqVO) => {
  return request.get({ url: '/platform/video/favourite/page', params: reqVO })
}

/**
 * 查看视频是否被收藏
 */
export const getVideoIsFavourite = (videoId: number) => {
  return request.get({ url: '/platform/video/favourite/isFavourite', params: { videoId } })
}

/**
 * 收藏视频
 */
export const saveFavourite = (data: any) => {
  return request.post({ url: '/platform/video/favourite/save', data })
}

/**
 * 取消收藏视频
 */
export const cancelFavourite = (videoId: number) => {
  return request.delete({ url: '/platform/video/favourite/cancel', params: { videoId } })
}
